<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Community_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-community_id" data-rule="required" class="form-control selectpicker" name="row[community_id]">
                {foreach name="communityList" item="vo" key="k"}
                <option value="{$k}" {if $k==$row.community_id}selected{/if}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Publicwelfare_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-publicwelfare_id" data-rule="required" class="form-control selectpicker" name="row[publicwelfare_id]">
                {foreach name="publicwelfareList" item="vo" key="k"}
                <option value="{$k}" {if $k==$row.publicwelfare_id}selected{/if}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>

    <div class="form-group">
        <label for="c-cover" class="control-label col-xs-12 col-sm-2">课程封面:</label>
        <div class="col-xs-12 col-sm-8" id="div-cover">
            <div class="input-group">
                <input id="c-cover" class="form-control" name="row[cover]" type="text" value="{$row.cover}" placeholder="请选择或上传课程封面">
                <div class="input-group-btn">
                    <button type="button" id="plupload-cover" class="btn btn-danger plupload" data-input-id="c-cover" data-mimetype="image/*" data-multiple="false" data-preview-id="p-cover"><i class="fa fa-upload"></i> {:__('Upload')}</button>
                    <button type="button" id="fachoose-cover" class="btn btn-primary fachoose" data-input-id="c-cover" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button>
                    <button type="button" class="btn btn-success ai-generate-image" data-type="ai-generate-course_cover" data-input-id="c-cover" data-width="1024" data-height="1024" data-say="为这个课程生成一张有创意的封面图片，风格现代简洁，色彩温暖" title="AI生成封面"><i class="fa fa-magic"></i> AI生成</button>
                </div>
            </div>
            <span class="msg-box n-right" for="c-cover"></span>
            <div class="form-inline">
                <img id="p-cover" class="img-responsive img-thumbnail plupload-preview" src="{$row.cover}" style="max-height:150px;display:{if $row.cover}block{else/}none{/if};" />
            </div>
        </div>
    </div>
    <div class="form-group">
        <label for="c-intro" class="control-label col-xs-12 col-sm-2">课程介绍:</label>
        <div class="col-xs-12 col-sm-8" id="div-intro">
            <div class="input-group">
                <textarea name="row[intro]" id="c-intro" class="form-control editor" data-rule="" rows="5" data-tip="课程介绍" placeholder="请输入课程介绍">{$row.intro}</textarea>
                <div class="input-group-btn" style="vertical-align: top;">
                    <button type="button" class="btn btn-success" data-ai-generate-text data-target-id="c-intro" data-prompt-template="为课程'{name}'生成简单的课程介绍以普通话形式输出，最多不超过200字。" data-max-length="1000" data-say="" title="AI生成介绍"><i class="fa fa-magic"></i> AI生成</button>
                </div>
            </div>
            <span class="msg-box n-right" for="c-intro"></span>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-remark" class="form-control" name="row[remark]" rows="5">{$row.remark|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', ['1'=>__('Status 1'), '0'=>__('Status 0')], $row.status)}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh}">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
